﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Pdm.Commons;

namespace Pdm.Solver
{
    class HeuristikSolver : Solver
    {
        private PdmOptimization opti;
        public HeuristikSolver(DmuList dmuList, int objectiveDmu, double[] urmWeights)
        {
            opti = new PdmOptimization(dmuList, objectiveDmu);

            for (int i = 0; i < opti.dmuList.coefficients.Count; i++)
            {
                //including input variables
                opti.urmWeights.Add(new SpecificationInstance(opti.dmuList.coefficients[i], urmWeights[i]));
            }
            Optimization deaOpt = new Optimization(dmuList, objectiveDmu);
            Optimizer.calculateDea(deaOpt);

            opti.setOptimizationDirections(deaOpt);
        }
        public HeuristikSolver(PdmOptimization opti)
        {

        }
        public override Pdm.Commons.PdmOptimization getOptimization(double alpha)
        {
            opti.alpha = alpha;
            Optimizer.calculatePdm(opti);
            return opti;
        }
    }
}
